
package com.aomiao.orderserver.service.impl;

/**
 * @author xiah
 * @date 2018/5/15 13:36
 * txmanager集群
 */


//@Service
/*public class TxManagerColony implements TxManagerTxUrlService {
       @Autowired
       private EurekaClient eurekaClient;
       @Value("${tm.manager.serviceId}")
       private String serviceId;

       @Override
       public String getTxUrl() {
              Application application = eurekaClient.getApplication(serviceId);
              if ( application != null ) {
                     List<InstanceInfo> txManger = application.getInstances();
                     InstanceInfo instanceInfo = txManger.get(new Random().nextInt(txManger.size()));
                     return instanceInfo.getHomePageUrl() + "/tx/manager/";

              } else {
                     return "http://127.0.0.1:8899/tx/manager/";
              }
              //System.out.println("load tm.manager.url ");


       }
}*/

